Skip to content

Conversation

@kikairoya
Copy link
Contributor

On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to "clang++.exe".

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Jun 6, 2025
@kikairoya kikairoya changed the title [Clant-Tools][Windows] Fix driver name transformation in scan-build [Clang-Tools][Windows] Fix driver name transformation in scan-build Jun 6, 2025
On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe"
from "clang-{ver}.exe" but should transform to "clang++.exe".
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Tomohiro Kashiwada (kikairoya)

Changes

On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to "clang++.exe".


Full diff: https://github.com/llvm/llvm-project/pull/143135.diff

1 Files Affected:

  • (modified) clang/tools/scan-build/bin/scan-build (+1-1)
diff --git a/clang/tools/scan-build/bin/scan-build b/clang/tools/scan-build/bin/scan-build
index b90e635d31757..da7fe94cf4c03 100755
--- a/clang/tools/scan-build/bin/scan-build
+++ b/clang/tools/scan-build/bin/scan-build
@@ -1898,7 +1898,7 @@ if ($Clang !~ /\+\+(\.exe)?$/) {
   # Determine operating system under which this copy of Perl was built.
   my $IsWinBuild = ($^O =~/msys|cygwin|MSWin32/);
   if($IsWinBuild) {
-    $ClangCXX =~ s/.exe$/++.exe/;
+    $ClangCXX =~ s/\-\d+(\.\d+)?.exe$/++.exe/;
   }
   else {
     $ClangCXX =~ s/\-\d+(\.\d+)?$//;

@kikairoya kikairoya force-pushed the scanbuild-windows branch from 206a121 to 7d6d268 Compare June 6, 2025 13:16
Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never used scan-build on Windows, but the patch looks harmless so let's fix this.

@steakhal steakhal merged commit b07a6da into llvm:main Jun 6, 2025
5 of 7 checks passed
@steakhal steakhal changed the title [Clang-Tools][Windows] Fix driver name transformation in scan-build [scan-build][Windows] Fix driver name transformation in scan-build Jun 6, 2025
@kikairoya kikairoya deleted the scanbuild-windows branch June 7, 2025 03:36
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…lvm#143135)

On Windows system, scan-build resolves clang++ driver name as
"clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to
"clang++.exe".
jeremyd2019 pushed a commit to jeremyd2019/llvm-project that referenced this pull request Aug 9, 2025
…lvm#143135)

On Windows system, scan-build resolves clang++ driver name as
"clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to
"clang++.exe".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants